<?php
namespace app\api\controller;
// namespace app\zw_admin\controller;
use \think\Controller;
use think\Db;
// use think\Controller;
use think\Session;
use think\Request;
use Endroid\QrCode\Tests;
use qrcode;
use alisms\SmsDemo;
class ActivityController extends Controller
{

    /**
     * 活动信息接口
     * @return [type] [description]
     */
    public function activity_list()
    {
        $type = input('param.type');
        $activityList = db('activity')->where(['type'=>$type])->order('time desc')->select();
        foreach ($activityList as $key => &$value) {
            $value['activity_img'] = 'http://www.mochoushop.com/'.$value['activity_img'];
            // dump($value);

        }
        // dump($activityList);
        // exit;
        if (!empty($activityList)) {
            echo json_encode(array("status"=>1,'message'=>'请求成功!',"data"=>$activityList));
            exit;
        }else{
            echo json_encode(array("status"=>2,'message'=>'请求失败!',"data"=>[]));
            exit;
        }
    }
}
